package com.usian.feign;

import com.usian.AdNode;
import com.usian.PageResult;
import com.usian.pojo.TbContent;
import com.usian.pojo.TbContentCategory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "usian-content-service")
public interface ContentFeign {

    @RequestMapping("selectContentCategoryByParentId")
    public List<TbContentCategory> selectContentCategoryByParentId(@RequestParam Long id);

    @RequestMapping("insertContentCategory")
    public Integer insertContentCategory(@RequestParam Long parentId,@RequestParam String name );

    @RequestMapping("deleteContentCategoryById")
    public Integer deleteContentCategoryById(@RequestParam Long categoryId);

    @RequestMapping("selectTbContentAllByCategoryId")
    public PageResult selectTbContentAllByCategoryId(@RequestParam Long categoryId,
                                                     @RequestParam Integer page,
                                                     @RequestParam Integer rows);
    @RequestMapping("insertTbContent")
    public  int  insertTbContent(@RequestBody TbContent tbContent);

    @RequestMapping("deleteContentByIds")
    public int deleteContentByIds(@RequestParam Long ids);

    @RequestMapping("selectFrontendContentByAD")
    public List<AdNode> selectFrontendContentByAD();

}
